@echo off
echo Starting Fire Detection Socket Server...
echo 正在启动火灾检测Socket服务器...

cd /d "D:\code\DT_project_brandnew\FireDetection_backend"

echo Checking Python environment...
echo 检查Python环境...

python --version
if %errorlevel% neq 0 (
    echo Python is not installed or not in PATH!
    echo Python未安装或未添加到PATH环境变量！
    pause
    exit /b 1
)

echo Installing required packages...
echo 安装所需的Python包...

pip install opencv-python requests pillow

echo Starting Fire Detection Socket Server on port 5000...
echo 在端口5000启动火灾检测Socket服务器...
echo.
echo This service provides:
echo 此服务提供：
echo - Socket connection for video streaming / Socket视频流连接
echo - Real-time fire detection / 实时火灾检测
echo - Client program support / 客户端程序支持
echo - Automatic frame processing / 自动帧处理
echo.
echo Make sure Ollama is running with gemma3:latest model
echo 请确保Ollama正在运行并已安装gemma3:latest模型
echo.
echo To start the client program, run:
echo 要启动客户端程序，请运行：
echo python client.py --host localhost --port 5000 --camera 0
echo.

python fire_detection_socket_server.py

pause
